<?php
set_time_limit(0);
 
include '../c/config.php';  
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
$nianji=9;

$query=$mysqli->query("select phone from s".$nianji." group by phone having count(phone) >1");
$phone =array();
while ($list = $query->fetch_assoc()) {
    $phone[]=$list['phone'];
}
var_dump($phone);
file_put_contents($nianji.'.txt', json_encode($phone));
